<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model app\models\Loan */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Loans', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="loan-view">

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'name',
            'mobile',
            [
                'attribute' => 'sex',
                'value' => function($data) {
                    if ($data->sex == 1) {
                        return '男';
                    } else if ($data->sex == 2) {
                        return '女';
                    } else {
                        return '性别填写有误';
                    }
                }
            ],
            'loan_amount',
            'loan_time',
            'loan_purpose',
            'remark',
            'ip',
            'create_time:datetime',
//            'update_time:datetime',
//            'status',
        ],
    ]) ?>

</div>
